package com.orders.commandFactory;

import java.util.HashMap;
import java.util.Map;

import com.orders.command.Command;
import com.orders.command.Publish;
import com.orders.console.ShutDown;
import com.orders.pojo.User;

public class UserCommandFactory extends AbstractCommandFactory {
	private static User user;
	private static Map map;
	public UserCommandFactory(User user){
		this.user = user;
	}

	static{
		  map = new HashMap<String,Command>();
		  map.put("publish", new Publish(user));
		  map.put("shutdown", new ShutDown());
	}
	@Override
	public  Command getCommandImp(String command){
		String cmd = command.toLowerCase();
		Command c = (Command) map.get(cmd);
		return c;
	}
}
